package com.gopay.common.cps.dao.cbrmb.impl;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.cbrmb.CbRmbBankMessageDtlDao;
import com.gopay.common.domain.cbrmb.CbRmbBankMessageDtl;

@Repository(value = "cbRmbBankMessageDtlDao")
public class CbRmbBankMessageDtlDaoImpl extends BaseDAOImpl<CbRmbBankMessageDtl, Serializable>
        implements CbRmbBankMessageDtlDao {

    @Override
    public CbRmbBankMessageDtl findByTranSn(String tranSn) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("tranSn", tranSn);
        List<CbRmbBankMessageDtl> messages = super.findByHql("from CbRmbBankMessageDtl where tranSn=:tranSn ", params);
        return messages.size() > 0 ? messages.get(0) : null;
    }

}
